
const User = require('../model/user.model')
const Blog = require('../model/blog.model')
class userService {
  async createUser(params){
    const json =  await User.create(params)
    return json
  }
  async getUserInfo(params){
    const json = await User.findOne({where:{ userName:params.userName }})
    return json
  }
  async resetPass(params){
    const json = await User.update({ passWord:params.passWord },{
      where:{
        userName:params.userName
      }
    })
    return json
  }
  async editInfo(params){
    const json = await User.update(params,{
      where:{
        userName:params.userName
      }
    })
    return json
  }
}

module.exports = new userService()